// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router'
import HelloWorld from '../components/HelloWorld.vue'
import ForbiddenPage from "../components/403.vue";
// 定义路由组件（示例）

import Login from '../components/login.vue'

// 路由配置
const routes = [
    {
        path: '/HelloWorld',
        component: HelloWorld,
        meta: { requiresAuth: true } // 需要认证的路由
    },
    {
        path: '/',
        name: 'Login',
        component: Login
    },
    {
        path: '/403',
        name: 'Forbidden',
        component: ForbiddenPage
    }

]

// 创建路由实例
const router = createRouter({
    history: createWebHistory(), // 使用 HTML5 History 模式
    routes
})

export default router